a = {
    1: "python",
    2: "C++",
    3: "Java",
    4: "C",
    5: "Rust"
}

#字典的遍历
for key in a:
    print(a, a[key])

print('---')
print(a.keys()) #使用keys()获得各个键值
print(a.values()) #使用values()获得各个values值
print(a.items()) #使用items()获得各个键值对

print('---')
for key, value in a.items():
    print(key, value)